************************************************
**************** Pointer Calculator *****************
*************** 2010 Done by FARID ***************
********** http://www.microbaz.blogfa.com ***********
************ Faridman1364@hotmail.com ************
************************************************
This tool simplify the procedure of pointer calculation for Nekketsu! Street Basket - Go for it, Dunk Heroes!.nes.
I hope someone with more knowledge and skill, develop this program, so that it will be more flexible in
calculating different kinds of pointers, at least for other nes games.


************************************************
Version History
************************************************
v 1.0 :
Can calculate one type of pointer in the game.

v 1.1 :
Can calculate two types of pointer in the game.

v 1.2 :
Can calculate CAPITAL WORDS to their hex value according to the game English table.

************************************************
Source code of version 1.0
************************************************
Public Function HextoDec(HexNum As String) As Long
Dim lngOut As Long
Dim i As Integer
Dim c As Integer

For i = 1 To Len(HexNum)
  c = Asc(UCase(Mid(HexNum, i, 1)))
  Select Case c
  
  Case 65 To 70
    lngOut = lngOut + ((c - 55) * 16 ^ (Len(HexNum) - i))
  
  Case 48 To 57
    lngOut = lngOut + ((c - 48) * 16 ^ (Len(HexNum) - i))
  
  Case Else
  
  
  End Select
Next i
HextoDec = lngOut
End Function
**********************************
Private Sub Calculate_Click()
offset = offset
decoffset = HextoDec(offset)
realoffset = decoffset - 16
Do Until realoffset < 65536
realoffset = realoffset - 65536
Loop
If realoffset > 49152 Then
  result = realoffset - 49152
ElseIf realoffset > 32768 Then
  result = realoffset - 32768
ElseIf realoffset > 16384 Then
  result = realoffset - 16384
ElseIf realoffset > 0 Then
  result = realoffset - 0
End If

BP = result + 32768
Dim a(4) As Integer
For x = 1 To 3
a(x) = BP Mod 16
BP = BP \ 16
Next x
a(4) = BP

revBP = a(2) * 16 ^ 3 + a(1) * 16 ^ 2 + a(4) * 16 + a(3)

pointer = Hex(revBP)
End Sub
**********************************
Private Sub Exit_Click()
End
End Sub